#ifndef	 	__QUEUE_H
#define		__QUEUE_H	
#include "includes.h"
#define	Max_Frame_Num	64

#define	DMA_TXn_LEN		1024	
#define	DMA_RXn_LEN 	1024
#define	Max_Queue_Size	(1024*4)
typedef struct Queue_Frame
{
    UINT8 *qu;      
    INT32 head;     
    INT32 tail;  
    INT32 qlength;  
    INT32 maxsize; 
	
	INT16 FrameCnt;
    INT16 FrameIn;
	INT16 FrameOut;
	INT16 FrameLen[Max_Frame_Num];	
	UINT8 *DMA_UARTn_TX_Buf;
	UINT8 *DMA_UARTn_RX_Buf;
}QUEUE_Frame;

//extern QUEUE_Frame Queue_Frame_Usartx;	

INT32 CreateQueue_Frame (QUEUE_Frame *q, INT32 qsize, UINT8 *qBUF, UINT8 *txBUF, UINT8 *rxBUF);
INT32 INIT_Queue_Frame(QUEUE_Frame *q);
INT32 Enqueue (QUEUE_Frame *q , UINT8 *buf,INT32 size);
INT32 Dequeue (QUEUE_Frame *q, UINT8 *buf,INT32 size);


extern QUEUE_Frame Queue_Frame_Usart2;	
extern QUEUE_Frame Queue_Frame_Usart3;



#define Max_Queue_Size_USART2	4096
#define	DMA_TX2_LEN		1024	
#define	DMA_RX2_LEN 	1024


#define Max_Queue_Size_USART3	1024
#define	DMA_TX3_LEN		512	
#define	DMA_RX3_LEN 	512


extern UINT8 USART2_Queue_Buf[Max_Queue_Size_USART2];
extern UINT8 DMA_UART2_TX_Buf[DMA_TX2_LEN];
extern UINT8 DMA_UART2_RX_Buf[DMA_RX2_LEN];



extern UINT8 USART3_Queue_Buf[Max_Queue_Size_USART3];
extern UINT8 DMA_UART3_TX_Buf[DMA_TX3_LEN];
extern UINT8 DMA_UART3_RX_Buf[DMA_RX3_LEN];





#endif

